package com.example.arithmeticleetcode.leetcode.September;

/**
 * @program: arithmetic-leetcode
 * @description:
 * @author: FangZhen
 * @create: 2020-09-28 10:07
 **/
public class Demo22 {

    public static void main(String[] args) {

    }

    public static boolean isBoomerang(int[][] points) {
        int xMaxValue = Integer.MIN_VALUE;
        int xMinValue = Integer.MAX_VALUE;
        int yMaxValue = Integer.MIN_VALUE;
        int yMinValue = Integer.MAX_VALUE;
        for (int[] point : points) {
            if (xMaxValue < point[0]) {
                xMaxValue = point[0];
            }
            if (xMinValue > point[0]) {
                xMinValue = point[0];
            }
            if (yMaxValue < point[1]) {
                yMaxValue = point[1];
            }
            if (yMinValue > point[1]) {
                yMinValue = point[1];
            }
        }
        if (Math.abs(xMaxValue - xMinValue)  == 0 || Math.abs(yMaxValue - yMinValue)  == 0) {
            return false;
        }
        return true;
    }
}
